﻿using NHibernate.Validator;
using System.ComponentModel.DataAnnotations;

namespace RMH.Entities
{
    public class Person : Entity
    {
        [Required]
        public virtual string FirstName { get; set; }
        
        public virtual string MiddleName { get; set; }

        [NotNullNotEmpty]
        public virtual string LastName { get; set; }

        [NotNullNotEmpty]    
        public virtual Address Address { get; set; }

        public virtual string EmailAddress { get; set; }
        
        public virtual string PhoneNumber { get; set; }
        public virtual string PhoneNumberAlternate { get; set; }
        public virtual string VehicleMake { get; set; }
        public virtual string VehicleModel { get; set; }
        public virtual string VehiclePlateState { get; set; }
        public virtual string VehiclePlateNumber { get; set; }

        public virtual string GetFullNameSortable()
        {
            return LastName + ", " + FirstName;
        }
        public virtual string GetFullName()
        {
            // HACK: i am so sorry so out of time.
            return (FirstName + " " + MiddleName + " " + LastName).Replace("  ", " ");
        }
    }
}